# Contributor: Orhun Parmaksız <orhunparmaksiz@gmail.com>
# Maintainer: Orhun Parmaksız <orhunparmaksiz@gmail.com>
pkgname=heh
pkgver=0.4.1
pkgrel=0
pkgdesc="A terminal UI to edit bytes by the nibble"
url="https://github.com/ndd7xv/heh"
arch="all !s390x" # FTBFS
license="MIT"
makedepends="
	cargo
	cargo-auditable
	"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/ndd7xv/heh/archive/v$pkgver.tar.gz"
options="net"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen
}

check() {
	cargo test --frozen
}

package() {
	install -Dm 755 "target/release/$pkgname" -t "$pkgdir/usr/bin"
	install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
	install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
}

sha512sums="
fc3ee5188f6fc5153f088c18d5f1b2d964b6ead73a89941f570cacbea7a7f21f614d9cf7297bc9ed85084b798971966f2d90844f084dc5098ba9efbb78466a0e  heh-0.4.1.tar.gz
"
